package String;

/**
 * char charArt(int index)
 * 提取指定位置上的字符
 */
public class ChatAtDemo {
    public static void main(String[] args) {

        String str = "www.tedu.cn";
        char c = str.charAt(4);
        System.out.println(c);

        for (int i=0;i<str.length();i++){
            c=str.charAt(i);
            System.out.println(c);
        }
        //检测会文
        String line = "上海自来水来自海上";
        for (int i=0;i<line.length()/2;i++){
            char c1 =line.charAt(i);
            char c2 =line.charAt(line.length()-1-i);
            if(c1!=c2){
                System.out.println("不");
                break;
            }
        }
        System.out.println("是回文");
    }
}
